<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>排行榜</title>
    <link rel="stylesheet" href="./css/reset.css">
    <style>
        .page{
            font-size: 0.4rem;
            color:red;
        }

    </style>
</head>

<body>
    <div class="page">


    </div>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    <script src="./js/rem.js"></script>

    <script>
        
        function getMyDate(str) {
            var oDate = new Date(str),
                oYear = oDate.getFullYear(),
                oMonth = oDate.getMonth() + 1,
                oDay = oDate.getDate(),
                oHour = oDate.getHours(),
                oMin = oDate.getMinutes(),
                oSen = oDate.getSeconds(),
                oTime = oYear + '-' + addZero(oMonth) + '-' + addZero(oDay) + ' ' + addZero(oHour) + ':' +
                    addZero(oMin) + ':' + addZero(oSen);
            return oTime;
        }

        function addZero(num) {
            if (parseInt(num) < 10) {
                num = '0' + num;
            }
            return num;
        }
       
        console.log(new Date())
        var a= new Date();
        var year =a.toLocaleString();
        console.log(year)
       var val= year.slice(0,10);
       var val2 =year.slice(12)
       var val3 =val+val2;
        console.log(val3.split('/').join('-'))
        var val4=val3.split('/').join('-');
        var oldTime = (new Date(val4)).getTime();
        var num =1578875153000;
        console.log(oldTime)
        var newNum = oldTime -num;
        console.log(newNum)
        $('.page')[0].innerHTML=getMyDate(newNum);
    </script>
</body>

</html>